<template>
	<view class="page" :style="themeColor">
		<view class="flex benben-position-layout flex flex-wrap align-center changePwdPhoneCode_flex_0"
			:style="{height:(64+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub changePwdPhoneCode_fd0_0'>
				<view class='flex flex-wrap align-center changePwdPhoneCode_fd0_0_c2' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
					<text class='fu-iconfont2  changePwdPhoneCode_fd0_0_c0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">&#xE794;</text>
				</view>
				<view class='flex flex-wrap align-stretch justify-center flex-sub'>
					<text class='changePwdPhoneCode_fd0_0_c1_c0'>修改密码</text>
				</view>
				<view class='flex flex-wrap align-center changePwdPhoneCode_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (64+StatusBarRpx)+'rpx'}"></view>

		<view class="changePwdPhoneCode_flex_1">
			<view class='changePwdPhoneCode_fd1_0'>我们要对您绑定的手机号进行验证：</view>			
			
			<view class="code_bg">
				<view class='changePwdPhoneCode_fd1_1'>{{userInfo.mobile}}</view>
				<benben-digital-password :box-num='4' mode='password'
					class-name="flex flex align-center justify-center changePwdPhoneCode_fd1_2" v-model="code">
					<template #default="{ content, active, index }">
						<view :key="index" v-if="active"
							class="flex align-center justify-center active-digital-password changePwdPhoneCode_flex_password_active_fd1_2">
							{{ content }}
						</view>
						<view :key="index" v-else
							class="flex align-center justify-center changePwdPhoneCode_flex_password_noActive_fd1_2">
							{{ content }}
						</view>
					</template>
				</benben-digital-password>
				<view class='flex flex-direction flex-wrap align-center justify-center changePwdPhoneCode_fd1_3'>
					<benben-send-verification-code class='flex  changePwdPhoneCode_fd1_3_c0' after-text='后重新获取'
						before-text='发送验证码' type='7' :phone="userInfo.phone"></benben-send-verification-code>
				</view>
			</view>
			
			
		</view>

		<view class="flex flex-direction flex-wrap align-center benben-position-layout flex changePwdOldCode_flex_2"
			@tap.stop="nextPageFunc()">
			<button class='changePwdOldCode_fd2_0'>下一步</button>
		
		</view>


	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"code": ""
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			userInfo: {
				get() {
					return this.$store.state.userInfo
				},
				set() {
					this.$store.commit('updateUserInfo', value)
				},
			}
		},
		watch: {},
		onLoad(options) {
			console.log(this.userInfo);
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//下一页
			nextPageFunc() {
				if (!validate(this.code, 'require')) {
					this.$message.info('请输入验证码');
					return false;
				}
				if (this.code.length < 4) {
					this.$message.info('请输入4位数字的验证码');
					return false;
				}
				this.$urouter.navigateTo(`/pages/xtsz/changePwdPhone/changePwdPhone?phone=${this.userInfo.phone}&code=${this.code}`);
			}
		}
	};
</script>
<style lang="scss" scoped>
	.code_bg {
		text-align: center;
		background: #f8f8f8;
		border-radius: 10rpx;
		padding: 63rpx 0 126rpx 0;
		margin-top: 25rpx;
	}
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #f8f8f8;
		background-size: 100% auto !important;
	}

	.changePwdPhoneCode_flex_0 {
		background: #fff;
		width: 100%;
		height: 64rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.changePwdPhoneCode_fd0_0_c2 {
		width: 50rpx;
		height: 50rpx;
	}

	.changePwdPhoneCode_fd0_0_c1_c0 {
		font-size: 25rpx;
		font-weight: 500;
		color: #333;
		line-height: 64rpx;
	}

	.changePwdPhoneCode_fd0_0_c0_c0 {
		font-size: 25rpx;
		font-weight: 500;
		color: #333;
	}

	.changePwdPhoneCode_fd0_0 {
		margin: 0rpx 25rpx 0rpx 25rpx;
	}

	.changePwdPhoneCode_flex_1 {
		margin: 16rpx 25rpx 0rpx 25rpx;
		background: #fff;
		border-radius: 10rpx;
		padding: 35rpx 34rpx 24rpx 34rpx;
		text-align: center;
	}

	.changePwdPhoneCode_fd1_4 {
		background: rgba(205, 150, 45, 1);
		border-radius: 50rpx 50rpx 50rpx 50rpx;
		font-size: 32rpx;
		color: #fff;
		margin: 32rpx 32rpx 32rpx 32rpx;
		height: 80rpx;
		line-height: 88rpx;
		width: 686rpx;
	}

	.changePwdPhoneCode_fd1_3_c0 {
		// line-height: 42rpx;
		font-size: 20rpx;
		color: #4087FD;
		text-align: center;
	}

	.changePwdPhoneCode_fd1_3 {
		width: 100%;
	}

	.changePwdPhoneCode_flex_password_noActive_fd1_2 {
		border: 1px solid #ccc;
		width: 63rpx;
		height: 63rpx;
		margin: 0rpx 5rpx 0rpx 5rpx;
	}

	.changePwdPhoneCode_flex_password_active_fd1_2 {
		border: 1px solid #409EFF;
		width: 63rpx;
		height: 63rpx;
		margin: 0rpx 5rpx 0rpx 5rpx;
	}

	::v-deep .changePwdPhoneCode_fd1_2 {
		width: 100%;
		height: 63rpx;
		margin: 25rpx 0rpx 35rpx 0rpx;
	}

	.changePwdPhoneCode_fd1_1 {
		margin-bottom: 25rpx;
		font-size: 18rpx;
		font-weight: 500;
		color: #999999;
	}

	.changePwdPhoneCode_fd1_0 {
		font-size: 20rpx;
		font-weight: 400;
		color: #333333;
	}
	
	.changePwdOldCode_flex_2 {
		width: 100%;
		// height: 88rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
		padding: 0 25rpx 35rpx;
	}
	
	.changePwdOldCode_fd2_0 {
		background: #4087FD;
		border-radius: 34rpx;
		font-size: 32rpx;
		color: #fff;
		width: 100%;
		height: 68rpx;
		line-height: 68rpx;
		font-size: 25rpx;
		font-weight: 500;
	}
</style>